package particlesystem.core {
	import particlesystem.graphics.BitmapAnimation;

	import flash.display.BitmapData;

	/**
	 * @author robertthurston
	 */
	public class ParticleData extends Object {

		public var x : Number;
		public var y : Number;
		public var direction : Number;
		public var xSpeed : Number;
		public var ySpeed : Number;
		public var bitmapAnimation : BitmapAnimation;
		public var gravity : Number;
		public var decay : Number;
		public var life : Number;
		public var reSpawn : Boolean;
		public var ground : Number;
		public var startDelay : Number;
		public var alphaFade : Number;
		public var alphaBitmapDataArray : Array;

		public function ParticleData(alphaBitmapDataArray : Array) {
			this.alphaBitmapDataArray = alphaBitmapDataArray;
		}

		public function get nextFrame() : BitmapData {
			return bitmapAnimation.getNextFrame();
		}

		public function toString() : String {
			return "[ParticleData] xSpeed:" + xSpeed + " ySpeed:" + ySpeed + " alphaFade:" + alphaFade;
		}

		public function get alphaBitmapData() : BitmapData {
			return alphaBitmapDataArray[Math.floor(alphaFade * 10)];
		}
	}
}
